#include <stdio.h>
struct student
{
    char num[500];
    char name[100];
    int score;
};
int main()
{
    int n;
    scanf("%d", &n);
    struct student s[100];
    double sum = 0, average = 0;
    for (int i = 0; i < n; i++)
    {
        scanf("%s %s %d", s[i].num, s[i].name, &s[i].score);
        sum += s[i].score;
    }
    average = sum / n;
    printf("%.2lf\n", average);
    for (int j = 0; j < n; j++)
    {
        if (s[j].score < average)
        {
            printf("%s ", s[j].name);
            printf("%s\n", s[j].num);
        }
    }
    return 0;
}